package com.webchat.client.payment.service;

import com.webchat.common.bean.APIResponseBean;
import com.webchat.common.bean.APIResponseBeanUtil;
import com.webchat.domain.vo.response.publicaccount.ArticleBaseResponseVO;
import com.webchat.rmi.pgc.OfficialArticleClient;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class ArticleService {


    @Autowired
    private OfficialArticleClient officialArticleClient;

    /**
     * 获取文章详情
     *
     * @param id
     * @return
     */
    public ArticleBaseResponseVO detail(Long id, String userId) {
        APIResponseBean<ArticleBaseResponseVO> responseBean = officialArticleClient.detail(id, true);
        if (APIResponseBeanUtil.isOk(responseBean)) {
            return responseBean.getData();
        }
        return null;
    }
}
